use std::mem;

struct SAbc {
	name : String,
	id : i32,
}

trait SFun {
	fn helloworld(&mut self) -> i32;
}

impl SFun for SAbc {
	fn helloworld(&mut self) -> i32 {
		mem::replace(&mut self.name, "helloworld".to_string()); 
		self.id = 10;
		return self.id;
	}
}

fn main() {
	let  mut abc = SAbc{name:"hello".to_string(), id:3};
	abc.helloworld();
	println!("name:{}\nid:{}", abc.name, abc.id);
}